This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# returns a path with some special front/back values and dups removed | |
import os | |
import sys | |
def getenv(name): | |
try: | |
return os.environ[name].split(':') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
//go:generate gopherjs build --minify | |
import ( | |
"crypto/sha256" | |
"errors" | |
"github.com/gopherjs/gopherjs/js" | |
"github.com/miratronix/jopher" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m = require("./objtest3.js"); | |
h = m.newHasher("This is a test") | |
h.hash().then((r) => { | |
console.log("hash of '" + h.s + "' is:", r.slice(0, 4)) | |
}).catch((e) => { | |
console.log("Error: ", e) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func hashit(s string) []byte { | |
h := sha256.New() | |
h.Write([]byte(s)) | |
return h.Sum(nil) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
//go:generate gopherjs build --minify | |
// This is an experiment to see if gopherjs can reasonably generate js code from go source | |
// so that we can have a single-source solution for keys and addresses. | |
// Use "go generate" to build this. | |
import ( | |
"crypto/sha256" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node | |
> simple=require("./simple.js") | |
{ hashit: [Function] } | |
> simple.hashit("This is a test") | |
Uint8Array [ | |
199, | |
190, | |
30, | |
217, | |
2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
simple = require("./simple.js"); | |
h = simple.hashit("This is a test") | |
console.log(h.length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
//go:generate gopherjs build --minify | |
import ( | |
"crypto/sha256" | |
"github.com/gopherjs/gopherjs/js" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m = require("./objtest.js"); | |
h = m.hashobj({ | |
name: "Kent", | |
address: "Somewhere in Space and Time", | |
city: "Specificity", | |
state: "CT" | |
}) | |
console.log(h.slice(0, 4)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
//go:generate gopherjs build --minify | |
import ( | |
"crypto/sha256" | |
"github.com/gopherjs/gopherjs/js" | |
) |