react / wstein / node_modules / browserify / node_modules / shasum / node_modules / sha.js / sha224.js
80538 views/**1* A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined2* in FIPS 180-23* Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.4* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet5*6*/78var inherits = require('inherits')9var SHA256 = require('./sha256')10var Hash = require('./hash')1112var W = new Array(64)1314function Sha224() {15this.init()1617this._w = W // new Array(64)1819Hash.call(this, 64, 56)20}2122inherits(Sha224, SHA256)2324Sha224.prototype.init = function () {25this._a = 0xc1059ed8|026this._b = 0x367cd507|027this._c = 0x3070dd17|028this._d = 0xf70e5939|029this._e = 0xffc00b31|030this._f = 0x68581511|031this._g = 0x64f98fa7|032this._h = 0xbefa4fa4|03334return this35}3637Sha224.prototype._hash = function () {38var H = new Buffer(28)3940H.writeInt32BE(this._a, 0)41H.writeInt32BE(this._b, 4)42H.writeInt32BE(this._c, 8)43H.writeInt32BE(this._d, 12)44H.writeInt32BE(this._e, 16)45H.writeInt32BE(this._f, 20)46H.writeInt32BE(this._g, 24)4748return H49}5051module.exports = Sha224525354