git ssb

1+

Dominic / ssb-keys



Commit de2e69c05bf715f6fad6a795f6467828c73b49ff

use ssb-ref

Dominic Tarr committed on 6/29/2015, 5:25:18 PM
Parent: 6e2caf166bc8442bf3b6c8eef5871f9392031d08

Files changed

index.jschanged
package.jsonchanged
index.jsView
@@ -7,8 +7,9 @@
77 var createHmac = require('hmac')
88 var Blake2s = require('blake2s')
99
1010 var ecc = require('./eccjs')
11+var isRef = require('ssb-ref')
1112
1213 //UTILS
1314
1415 function clone (obj) {
@@ -23,16 +24,14 @@
2324 function hash (data, enc) {
2425 return new Blake2s().update(data, enc).digest('base64') + '.blake2s'
2526 }
2627
27-function isHash (data) {
28- return isString(data) && /^[A-Za-z0-9\/+]{43}=\.blake2s$/.test(data)
29-}
3028
31-function isId (data) {
32- return isString(data) && /^[A-Za-z0-9\/+]{43}=\.(?:ed25519|blake2s)$/.test(data)
33-}
29+var isHash = isRef.isHash
30+var isFeedId = isRef.isFeedId
3431
32+exports.hash = hash
33+exports.isHash = isHash
3534
3635 function isObject (o) {
3736 return 'object' === typeof o
3837 }
@@ -40,14 +39,8 @@
4039 function isFunction (f) {
4140 return 'function' === typeof f
4241 }
4342
44-exports.isHash = isHash
45-exports.hash = hash
46-
47-exports.isId = isId
48-exports.isIdentity = isId
49-
5043 function isString(s) {
5144 return 'string' === typeof s
5245 }
5346
package.jsonView
@@ -13,9 +13,10 @@
1313 "eccjs": "git://github.com/dominictarr/eccjs.git#586f6d47507184a2efe84684ed0a30605cbc43a5",
1414 "hmac": "~1.0.1",
1515 "libsodium-wrappers": "^0.2.8",
1616 "mkdirp": "~0.5.0",
17- "sodium": "^1.0.17"
17+ "sodium": "^1.0.17",
18+ "ssb-ref": "~0.0.0"
1819 },
1920 "devDependencies": {
2021 "tape": "~3.0.0"
2122 },
@@ -26,5 +27,5 @@
2627 "test": "set -e; for t in test/*.js; do node $t; done"
2728 },
2829 "author": "Paul Frazee <pfrazee@gmail.com>",
2930 "license": "MIT"
30-}
31+}

Built with git-ssb-web