SHA256 Signature

Vahid sabeti.ltd at gmail.com
Tue Jun 18 06:49:24 UTC 2024


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.representation).toHexString!(LetterCase.lower).to!string;
```


More information about the Digitalmars-d-learn mailing list