Skip to content

shanghai-edu/eduid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shanghai-Edu-ID

examples

golang example

package main

import (
	"fmt"

	eduid "github.com/shanghai-edu/eduid/golang"
)

func main() {
	fmt.Println(eduid.GenerateShanghaiEduID("110101200101016874"))
    // 4788e071-bdc7-54a8-a187-0c6d6da9a237
}

python example

get eduid.py from https://github.com/shanghai-edu/eduid

# -*- coding: utf-8 -*-
import eduid

print(eduid.GenerateShanghaiEduID("110101200101016874"))
# 4788e071-bdc7-54a8-a187-0c6d6da9a237

php example

get eduid.php from https://github.com/shanghai-edu/eduid

<?php
include 'eduid.php';

echo GenerateShanghaiEduID("110101200101016874")
# 4788e071-bdc7-54a8-a187-0c6d6da9a237
?>

C# example

get eduid.cs from https://github.com/shanghai-edu/eduid

string UUID = eduid.GenerateShanghaiEduID("110101200101016874");
Console.WriteLine(UUID);

Java example

get eduid.java from https://github.com/shanghai-edu/eduid

String result = eduid.GenerateShanghaiEduID("110101200101016874");
System.out.println(result);

MySQL example

import eduid.sql from https://github.com/shanghai-edu/eduid

select eduid('110101200101016874') as eduid
-- 4788e071-bdc7-54a8-a187-0c6d6da9a237

tools

# tool -h
Usage of tool:
  -s string
        string to generate eduid
  -v    show version

# tool -s 110101200101016874
4788e071-bdc7-54a8-a187-0c6d6da9a237