mirror of
				https://github.com/weloe/token-go.git
				synced 2025-10-31 10:56:31 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			171 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			171 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package util
 | |
| 
 | |
| import (
 | |
| 	"crypto/md5"
 | |
| 	"fmt"
 | |
| )
 | |
| 
 | |
| func MD5(str string) string {
 | |
| 	data := []byte(str)
 | |
| 	has := md5.Sum(data)
 | |
| 	md5str := fmt.Sprintf("%x", has)
 | |
| 	return md5str
 | |
| }
 | 
