git ssb

1+

Dominic / ssb-keys



Tree: 68df1eba527e24ae3645414bbadd9f374f16d524

Files: 68df1eba527e24ae3645414bbadd9f374f16d524 / test / weird.js

1617 bytesRaw
1var expected = "lFluepOmDxEUcZWlLfz0rHU61xLQYxknAEd6z4un8P8=.sha256"
2var msg = {
3 "previous": "%VBfEJjeNUlxLuK0eyRzVha3TLu5PPWLwsvGgnmAdPas=.sha256",
4 "author": "@/02iw6SFEPIHl8nMkYSwcCgRWxiG6VP547Wcp1NW8Bo=.ed25519",
5 "sequence": 2888,
6 "timestamp": 1457679971682,
7 "hash": "sha256",
8 "content": {
9 "type": "post",
10 "text": "oh no\n\nhttps://medium.com/making-instapaper/bookmarklets-are-dead-d470d4bbb626\n\n> The ultimate catch-22 of the new Content Security Policy wording is that it’s intended to benefit the users, by providing additional security from hypothetical malicious add-ons on websites that enforce a Content Security Policy. In the end the bookmarklet has been relegated obsolete by the change, a casualty of one clause in one section of one web specification, and end-users and developers are the ones who will mourn its demise. The path to hell is paved with good intentions.\n\n> I’d probably try to do more about it, but I’m too busy rewriting Instapaper’s bookmarklet into extensions for every major browser.\n\nhttps://www.youtube.com/watch?v=n5diMImYIIA",
11 "root": "%VBfEJjeNUlxLuK0eyRzVha3TLu5PPWLwsvGgnmAdPas=.sha256",
12 "branch": "%VBfEJjeNUlxLuK0eyRzVha3TLu5PPWLwsvGgnmAdPas=.sha256",
13 "channel": "javascript"
14 },
15 "signature": "Pv+LWJumKE8nIOfsZxgMcg/EcR/tZeJShmiVIGizERuiAMzwzTTjg78r+InmJopJwMogEG7/W3FLTnH/EOzLCg==.sig.ed25519"
16}
17
18
19var tape = require('tape')
20var ssbKeys = require('../')
21
22tape('test that the legacy code is as expected', function (t) {
23 var actual = ssbKeys.hash(JSON.stringify(msg, null, 2))
24 t.equal(actual, expected)
25 t.end()
26})
27
28
29
30
31

Built with git-ssb-web