mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 09:05:46 +00:00
30 lines
580 B
Plaintext
30 lines
580 B
Plaintext
/^ Create bytearray but with secure random bytes in it instead of zeros ^/
|
|
func Crypto.RandomBytes(byteCount, personalString)
|
|
{
|
|
|
|
}
|
|
/^
|
|
Hash passwords with PBKDF2
|
|
shanum:
|
|
1: sha1 (please don't)
|
|
224: sha224 (please use this)
|
|
256: sha256 (vunerable to length extension attack)
|
|
384: sha384 (perferably this)
|
|
512: sha512 (vunerable to length extension attack)
|
|
|
|
^/
|
|
func Crypto.PBKDF2(pass,salt,itterations,keylen,shanum)
|
|
{
|
|
|
|
}
|
|
/^ Base64 Encode ^/
|
|
func Crypto.Base64Encode(bytes)
|
|
{
|
|
|
|
}
|
|
|
|
/^ Base64 Decode ^/
|
|
func Crypto.Base64Decode(str)
|
|
{
|
|
|
|
} |