Skip to content

Commit

Permalink
fixed typing exports
Browse files Browse the repository at this point in the history
  • Loading branch information
hortinstein committed Jan 25, 2023
1 parent b0ec401 commit 560e87b
Show file tree
Hide file tree
Showing 7 changed files with 260 additions and 257 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {
generateKeyPair,
unwrap,
wrap
} from "https://deno.land/x/[email protected].2/typescript/mod.ts";
} from "https://deno.land/x/[email protected].5/typescript/mod.ts";

const hello_world = new TextEncoder().encode("Hello World");
const [priv, pub] = generateKeyPair();
Expand Down
2 changes: 1 addition & 1 deletion enkodo.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.1.4"
version = "0.1.5"
author = "Alex"
description = "A cross platform encyption and serialization library"
license = "MIT"
Expand Down
16 changes: 2 additions & 14 deletions src/enkodo.nim
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import monocypher
import sysrandom

type
Hash* = array[64, byte]
Key* = array[32, byte]
Nonce* = array[24, byte]
Mac* = array[16, byte]
Signature* = array[64, byte]

type
EncObj* = object
publicKey*: Key
nonce*: Nonce
mac*: Mac
cipherLen*: int
cipherText*: seq[byte]
import enkodo/serialize
export serialize

#[
helper function to convert bytes to string
Expand Down
19 changes: 18 additions & 1 deletion src/enkodo/serialize.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import std/base64
import types
import flatty

import types

type
Hash* = array[64, byte]
Key* = array[32, byte]
Nonce* = array[24, byte]
Mac* = array[16, byte]
Signature* = array[64, byte]

type
EncObj* = object
publicKey*: Key
nonce*: Nonce
mac*: Mac
cipherLen*: int
cipherText*: seq[byte]


when defined(js):
import jsffi
var module {.importc.}: JsObject
Expand Down
2 changes: 1 addition & 1 deletion src/enkodo/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ type
nonce*: Nonce
mac*: Mac
cipherLen*: int
cipherText*: seq[byte]
cipherText*: seq[byte]
2 changes: 0 additions & 2 deletions tests/test_nim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import std/base64
import flatty

import enkodo
import enkodo/types
import enkodo/serialize

proc writeStringToFile*(fileName: string, contents: string) =
let f = open(filename, fmWrite)
Expand Down
Loading

0 comments on commit 560e87b

Please sign in to comment.