Created
September 2, 2019 03:17
-
-
Save islishude/b54325c875f23a46735b329ab61d8546 to your computer and use it in GitHub Desktop.
address generator tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
// ethereum address generator | |
{ | |
var uncompressed = make([]byte, 65) | |
hash := sha3.NewLegacyKeccak256() | |
hash.Write(uncompressed[1:]) | |
address := fmt.Sprintf("%#x", hash.Sum(nil)[12:]) | |
} | |
// EOS address generator | |
{ | |
var compressed = make([]byte, 33) | |
hash := ripemd160.New() | |
hash.Write([]byte(compressed)) | |
address := fmt.Sprintf("EOS%s", base58.Encode(append(compressed, hash.Sum(nil)[:4]...))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment