Skip to content

joy-framework/codec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codec

encode/decode library for janet

Install

Add to your project.janet file

{:dependencies ["https://github.com/joy-framework/codec"]}

Use

(import codec)

(= "hello there!" (codec/decode (codec/encode "hello there!")))

HMAC Hex Digests

Codec can also perform sha1 hmac digests on strings

(import codec)

(codec/hmac-sha1 "secret token" "hello world")

This should be equivalent to the following ruby code:

OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), 'secret token', 'hello world')