How to hash SHA256 from string?

An Pham home at home.com
Sat Dec 2 16:20:45 UTC 2023


On Saturday, 2 December 2023 at 15:30:39 UTC, zoujiaqing wrote:
> ```D
>     string appKey = 
> "11111111111111111111111111111111111111111111111111111";
>     ubyte[1024] data = cast(ubyte[])(appKey.dup[0..$]);
>     sha256.put(data);

Your data has garbage at the end; try 
sha256.put(data[0..appKey.length])


More information about the Digitalmars-d-learn mailing list