use standardjs formatting
This commit is contained in:
parent
09d8e440de
commit
399803affa
41 changed files with 1252 additions and 1177 deletions
test
|
@ -1,12 +1,14 @@
|
|||
/* global describe, it */
|
||||
|
||||
var assert = require('assert')
|
||||
var crypto = require('../src/crypto')
|
||||
|
||||
var fixtures = require('./fixtures/crypto.json')
|
||||
|
||||
describe('Crypto', function() {
|
||||
describe('HASH160', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.before.hex.forEach(function(hex, i) {
|
||||
describe('Crypto', function () {
|
||||
describe('HASH160', function () {
|
||||
it('matches the test vectors', function () {
|
||||
fixtures.before.hex.forEach(function (hex, i) {
|
||||
var data = new Buffer(hex, 'hex')
|
||||
var actual = crypto.hash160(data).toString('hex')
|
||||
|
||||
|
@ -15,9 +17,9 @@ describe('Crypto', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('HASH256', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.before.hex.forEach(function(hex, i) {
|
||||
describe('HASH256', function () {
|
||||
it('matches the test vectors', function () {
|
||||
fixtures.before.hex.forEach(function (hex, i) {
|
||||
var data = new Buffer(hex, 'hex')
|
||||
var actual = crypto.hash256(data).toString('hex')
|
||||
|
||||
|
@ -26,9 +28,9 @@ describe('Crypto', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('RIPEMD160', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.before.hex.forEach(function(hex, i) {
|
||||
describe('RIPEMD160', function () {
|
||||
it('matches the test vectors', function () {
|
||||
fixtures.before.hex.forEach(function (hex, i) {
|
||||
var data = new Buffer(hex, 'hex')
|
||||
var actual = crypto.ripemd160(data).toString('hex')
|
||||
|
||||
|
@ -37,9 +39,9 @@ describe('Crypto', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('SHA1', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.before.hex.forEach(function(hex, i) {
|
||||
describe('SHA1', function () {
|
||||
it('matches the test vectors', function () {
|
||||
fixtures.before.hex.forEach(function (hex, i) {
|
||||
var data = new Buffer(hex, 'hex')
|
||||
var actual = crypto.sha1(data).toString('hex')
|
||||
|
||||
|
@ -48,9 +50,9 @@ describe('Crypto', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('SHA256', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.before.hex.forEach(function(hex, i) {
|
||||
describe('SHA256', function () {
|
||||
it('matches the test vectors', function () {
|
||||
fixtures.before.hex.forEach(function (hex, i) {
|
||||
var data = new Buffer(hex, 'hex')
|
||||
var actual = crypto.sha256(data).toString('hex')
|
||||
|
||||
|
@ -59,9 +61,9 @@ describe('Crypto', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('HmacSHA256', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.before.hex.forEach(function(hex, i) {
|
||||
describe('HmacSHA256', function () {
|
||||
it('matches the test vectors', function () {
|
||||
fixtures.before.hex.forEach(function (hex, i) {
|
||||
var data = new Buffer(hex, 'hex')
|
||||
var secret = new Buffer(fixtures.before.secret)
|
||||
var actual = crypto.HmacSHA256(data, secret).toString('hex')
|
||||
|
@ -71,9 +73,9 @@ describe('Crypto', function() {
|
|||
})
|
||||
})
|
||||
|
||||
describe('HmacSHA512', function() {
|
||||
it('matches the test vectors', function() {
|
||||
fixtures.before.hex.forEach(function(hex, i) {
|
||||
describe('HmacSHA512', function () {
|
||||
it('matches the test vectors', function () {
|
||||
fixtures.before.hex.forEach(function (hex, i) {
|
||||
var data = new Buffer(hex, 'hex')
|
||||
var secret = new Buffer(fixtures.before.secret)
|
||||
var actual = crypto.HmacSHA512(data, secret).toString('hex')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue