Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
digestType!Hash _digestImpl(Hash)(scope const(void[])[] data...) { Hash hash; hash.start(); foreach(datum; data) hash.put(cast(const(ubyte[]))datum); return hash.finish(); } digestType!Hash digest(Hash, T...)(T args) { static if(args.length == 1) { alias ElementType!(typeof(args[0])) elemType; static if(isInputRange!(typeof(args[0])) && is(typeof({Hash ha; elemType val; ha.put(val);}))) { Hash hash; hash.start(); copy(args[0], hash); return hash.finish(); } else { return _digestImpl!(Hash)(args); } } else { return _digestImpl!(Hash)(args); } } //simple alias doesn't work here, hope this gets inlined... auto md5Of(T...)(T args) { return digest!(MD5, T)(args); }
Username
Message
Add comment
Paste info
Author:
Guest
Views:
143
Private:
no
Expires:
Never
Uploaded:
08.08.12 20:50
Votes
:
0
Tweet
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason