AWS API Dlang, hmac sha256 function.

Rikki Cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 2 22:02:56 PDT 2015


On 03/10/15 6:01 PM, Rikki Cattermole wrote:
> On 03/10/15 4:54 PM, holo wrote:
>> On Saturday, 3 October 2015 at 03:15:21 UTC, Rikki Cattermole wrote:
>>>
>>> You could implement it yourself, (it looks pretty easy).
>>> Or go the route of Botan:
>>> https://github.com/etcimon/botan/blob/3bdc835d5b9bad7523deaa86fe98b1fbb2f09d6b/source/botan/mac/hmac.d
>>>
>>>
>>
>>
>> Thank you for answer. I used dub to fetch botan, after that i created
>> project:
>>
>> dub init projectname botan
>>
>> and tried to add botan module:
>>
>> $ cat app.d
>> #!/usr/bin/rdmd
>>
>> import std.stdio;
>> import botan.mac.hmac;
>>
>> void main()
>> {
>>      writeln("Edit source/app.d to start your project.");
>> }
>>
>> but when im trying to run my simple app i get:
>>
>> $ ./app.d
>> ./app.d(4): Error: module hmac is in file 'botan/mac/hmac.d' which
>> cannot be read
>> import path[0] = .
>> import path[1] = /usr/include/dlang/dmd
>> Failed: ["dmd", "-v", "-o-", "./app.d", "-I."]
>>
>> What am i doing wrong? How to add library with dub package manager? Im
>> really beginner in D (basically in programming) sorry if im asking
>> obvious questions.
>
> By the looks of that error message with paths, botan isn't actually
> added as a dependency. Can you please paste the dub file?

Ohhhh wait nevermind.
Use dub to compile/run your program. You are using the shebang line!

$ dub run

>> According to my other question are that functions equivalent to that
>> python one? If they are not doing exact that same i could not create
>> auth string which is needed to connect to AWS api.
>
> I can't say for certain if it is not exact. The reason I did not answer
> it is because I am not familiar with environment or any of what you are
> doing.
> I can unfortunately only point you in the right direction.



More information about the Digitalmars-d-learn mailing list