How to hash SHA256 from string?

zoujiaqing zoujiaqing at gmail.com
Sun Dec 3 13:42:53 UTC 2023


Thank u every one ;)

Use botan so easy:
```D
import std.stdio;
import botan;

void main()
{
     string appKey = 
"11111111111111111111111111111111111111111111111111111";

     auto sha256 = retrieveHash("SHA-256").clone();
     sha256.update(appKey);

     string sign = 
sha256.finished()[].toHexString!(LetterCase.lower);

     writeln("sign: %s", sign);
}
```


More information about the Digitalmars-d-learn mailing list