Skip to content

Commit

Permalink
Add serialization module
Browse files Browse the repository at this point in the history
  • Loading branch information
ngua committed Jan 17, 2022
1 parent e41718c commit 916ef78
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Lib/Serialization.js
@@ -0,0 +1,5 @@
"use strict";

const Buffer = require("buffer/").Buffer;

exports._hexToBytes = (hex) => Buffer.from(hex, "hex");
14 changes: 14 additions & 0 deletions src/Lib/Serialization.purs
@@ -0,0 +1,14 @@
module Lib.Serialization
( Buffer
, Hex(..)
, _hexToBytes
) where

import Prelude

newtype Hex
= Hex String

foreign import data Buffer :: Type

foreign import _hexToBytes :: Hex -> Buffer

0 comments on commit 916ef78

Please sign in to comment.