Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
[[tags: egg]] == sha1 [[toc:]] == Documentation Computes SHA1 (FIPS-180-1) checksums See [[message-digest-primitive]] for more information. === SHA1 API Component export ==== Usage <enscript language=scheme> (use sha1-api) </enscript> ==== Constants ; name : algorithm name ; {{symbol}} ; version : algorithm version ; {{string}} ; context-size : context byte length ; {{fixnum}} ; digest-length : final byte length ; {{fixnum}} ; block-length : buffer byte length ; {{fixnum}} Note that {{block-length}} is informational only. ==== init <procedure>(init CTX)</procedure> Initializes a SHA1 {{CTX}}, with at least {{context-size}} byte size. ==== update <procedure>(update CTX OBJ LEN)</procedure> Accumulate {{LEN}} bytes from the Scheme {{OBJ}} into {{CTX}}. ==== raw-update <procedure>(raw-update CTX PTR LEN)</procedure> Accumulate {{LEN}} bytes from the byte {{PTR}} into {{CTX}}. ==== final <procedure>(final CTX OBJ)</procedure> Finalize the {{CTX}} into a Scheme {{OBJ}} with at least {{digest-length}} byte size. The target is usually a {{blob}}, {{u8vector}}, or {{string}}. === SHA1 Primitive Packaged export ==== Usage <enscript language=scheme> (use sha1-primitive) </enscript> ==== sha1-primitive <procedure>(sha1-primitive) -> message-digest-primitive</procedure> Returns the SHA1 checksum digest primitive object. == Usage <enscript language=scheme> (import sha1) </enscript> == Example * '''Note''' the {{message-digest-utils}} egg is a dependency for the example. <enscript highlight="scheme"> (import sha1-primitive message-digest-byte-vector) (message-digest-string (sha1-primitive) "abc") ;=> "a9993e364706816aba3e25717850c26c9cd0d89d" </enscript> == Notes * The {{...-primitive}} API is for use with the [[message-digest]] extensions. And the {{...-api}} API implements the {{...-primitive}} API. One packages the algorithm as a record, the other a module. == Requirements [[message-digest-primitive]] == Author Steve Reid, packaged for Chicken by Peter Bex, C5 by [[kon lovett]] == Repository This egg is hosted on the CHICKEN Subversion repository: [[https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/sha1|https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/sha1]] If you want to check out the source code repository of this egg and you are not familiar with Subversion, see [[/egg-svn-checkout|this page]]. == Version history ; 4.1.0 : Split into api & primitive modules. ; 4.0.0 : CHICKEN 5 release. ; 3.2.0 : Add raw-update. [[/users/kon-lovett|Kon Lovett]] ; 3.1.0 : Add block-length. [[/users/kon-lovett|Kon Lovett]] ; 3.0.0 : Remove deprecated procedures. [[/users/kon-lovett|Kon Lovett]] ; 2.3 : Make function declarations {{static}} in order to avoid conflicts with those from libc if the OS supplies them. This makes SHA-1 work on OpenBSD (thanks to Alan Post and Christian Kellermann) ; 2.2.2 : Change deprecated {{pointer}} foreign type specifier to {{scheme-pointer}} to make it work under chickens newer than 4.6.0. ; 2.2.1 : Fix for test, wrong context allocation size. [[/users/kon-lovett|Kon Lovett]] ; 2.2 : a {{message-digest-primitive}} has no "state". [[/users/kon-lovett|Kon Lovett]] ; 2.1 : Replaced GPL code with common public domain code. ; 2.0.0 : Initial Chicken 4 release [[/users/kon-lovett|Kon Lovett]] == License SHA-1 in C By Steve Reid <steve@edmweb.com> 100% Public Domain
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 5 by 3?