Re: SHA256 Signature

2024-06-18 Thread Vahid via Digitalmars-d-learn
On Tuesday, 18 June 2024 at 17:18:18 UTC, Erdem wrote: On Tuesday, 18 June 2024 at 06:49:24 UTC, Vahid wrote: How can I create a SHA256 signature hash in D? Does this do what you want? ```d import std.digest.md; import std.digest.sha; import std.stdio; void main() { auto key

Re: SHA256 Signature

2024-06-18 Thread Erdem via Digitalmars-d-learn
On Tuesday, 18 June 2024 at 06:49:24 UTC, Vahid wrote: How can I create a SHA256 signature hash in D? Does this do what you want? ```d import std.digest.md; import std.digest.sha; import std.stdio; void main() { auto key = makeDigest!SHA256(); key.put(cast(ubyte[])"

SHA256 Signature

2024-06-17 Thread Vahid via Digitalmars-d-learn
Hi, How can I create a SHA256 signature hash in D? Something similar to the PHP code below: ```php openssl_sign($body, $signature, $secret, OPENSSL_ALGO_SHA256); ``` I've tried the code below without success: ```d auto signature = body.representation.hmac!SHA256(secret.represent