functionalscript 0.0.466 → 0.0.468
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/com/cpp/com.hpp +37 -4
- package/com/cpp/module.f.cjs +3 -1
- package/com/cpp/test.f.cjs +1 -1
- package/com/test/build.f.cjs +3 -3
- package/com/test/cpp/main.cpp +22 -2
- package/com/test/cs/Program.cs +8 -1
- package/fsm/module.f.cjs +48 -5
- package/fsm/test.f.cjs +74 -0
- package/package.json +1 -1
- package/sha2/module.f.cjs +28 -24
- package/types/byte_set/module.f.cjs +2 -0
- package/types/range_map/module.f.cjs +5 -0
package/com/cpp/com.hpp
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
namespace com
|
|
17
17
|
{
|
|
18
|
-
constexpr uint64_t byteswap(uint64_t v)
|
|
18
|
+
constexpr uint64_t byteswap(uint64_t v) noexcept
|
|
19
19
|
{
|
|
20
20
|
v = v >> 8 & 0x00FF00FF00FF00FF |
|
|
21
21
|
v << 8 & 0xFF00FF00FF00FF00;
|
|
@@ -97,19 +97,49 @@ namespace com
|
|
|
97
97
|
p.Release();
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
template<class U>
|
|
101
|
+
ref<U> upcast() const noexcept
|
|
102
|
+
{
|
|
103
|
+
return ref<U>(p);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
I* operator->() const noexcept
|
|
107
|
+
{
|
|
108
|
+
return &p;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
I* unsafe_result() const noexcept
|
|
112
|
+
{
|
|
113
|
+
p.AddRef();
|
|
114
|
+
return &p;
|
|
115
|
+
}
|
|
100
116
|
private:
|
|
101
117
|
I &p;
|
|
102
118
|
};
|
|
103
119
|
|
|
120
|
+
template<class I>
|
|
121
|
+
ref<I> to_ref(I& p) noexcept
|
|
122
|
+
{
|
|
123
|
+
return ref<I>(p);
|
|
124
|
+
}
|
|
125
|
+
|
|
104
126
|
constexpr static GUID const iunknown_guid =
|
|
105
127
|
GUID(0x00000000'0000'0000, 0xC000'000000000046);
|
|
106
128
|
|
|
107
|
-
template <class I>
|
|
108
|
-
constexpr GUID interface_guid();
|
|
109
|
-
|
|
110
129
|
template <class T>
|
|
111
130
|
class implementation : public T
|
|
112
131
|
{
|
|
132
|
+
public:
|
|
133
|
+
template<class ...U>
|
|
134
|
+
static T* create_raw(U... u)
|
|
135
|
+
{
|
|
136
|
+
return new implementation(u...);
|
|
137
|
+
}
|
|
138
|
+
template<class ...U>
|
|
139
|
+
static ref<T> create(U... u)
|
|
140
|
+
{
|
|
141
|
+
return to_ref(*create_raw(u...));
|
|
142
|
+
}
|
|
113
143
|
private:
|
|
114
144
|
HRESULT COM_STDCALL QueryInterface(GUID const &riid, IUnknown **const ppvObject) noexcept override
|
|
115
145
|
{
|
|
@@ -142,6 +172,9 @@ namespace com
|
|
|
142
172
|
return c;
|
|
143
173
|
}
|
|
144
174
|
|
|
175
|
+
template<class ...U>
|
|
176
|
+
explicit implementation(U... u): T(u...) {}
|
|
177
|
+
|
|
145
178
|
std::atomic<ULONG> counter;
|
|
146
179
|
};
|
|
147
180
|
}
|
package/com/cpp/module.f.cjs
CHANGED
|
@@ -47,6 +47,8 @@ const cpp = name => lib => {
|
|
|
47
47
|
|
|
48
48
|
const type = objectType(id => `::com::ref<${id}>`)
|
|
49
49
|
|
|
50
|
+
const resultType = objectType(id => `${id}*`)
|
|
51
|
+
|
|
50
52
|
/** @type {(s: types.Field) => text.Item} */
|
|
51
53
|
const field = ([name, t]) => `${type(t)} ${name};`
|
|
52
54
|
|
|
@@ -56,7 +58,7 @@ const cpp = name => lib => {
|
|
|
56
58
|
const defStruct = s => mapField(entries(s.struct))
|
|
57
59
|
|
|
58
60
|
/** @type {(fa: types.FieldArray) => string} */
|
|
59
|
-
const cppResult = resultVoid(
|
|
61
|
+
const cppResult = resultVoid(resultType)
|
|
60
62
|
|
|
61
63
|
/** @type {(p: types.Field) => string} */
|
|
62
64
|
const param = ([name, t]) => `${objectType(id => `${id}&`)(t)} ${name}`
|
package/com/cpp/test.f.cjs
CHANGED
|
@@ -27,7 +27,7 @@ const f = () =>
|
|
|
27
27
|
' virtual ::com::BOOL* COM_STDCALL GetUnsafe() noexcept = 0;\n' +
|
|
28
28
|
' virtual void COM_STDCALL SetUnsafe(Slice* p, uint32_t size) noexcept = 0;\n' +
|
|
29
29
|
' virtual ::com::BOOL COM_STDCALL Some(IMy& p) noexcept = 0;\n' +
|
|
30
|
-
' virtual
|
|
30
|
+
' virtual IMy* COM_STDCALL GetIMy() noexcept = 0;\n' +
|
|
31
31
|
' virtual void COM_STDCALL SetManagedStruct(ManagedStruct a) noexcept = 0;\n' +
|
|
32
32
|
' };\n' +
|
|
33
33
|
'}'
|
package/com/test/build.f.cjs
CHANGED
|
@@ -71,8 +71,8 @@ const cpp = ({dirname, platform}) => ({
|
|
|
71
71
|
flat([
|
|
72
72
|
['clang', '-shared', '-o', output(platform)('testc')],
|
|
73
73
|
flags(platform),
|
|
74
|
-
[`${dirname}/cpp/main.cpp`]
|
|
75
|
-
),
|
|
74
|
+
[`${dirname}/cpp/main.cpp`],
|
|
75
|
+
]),
|
|
76
76
|
],
|
|
77
77
|
})
|
|
78
78
|
|
|
@@ -85,7 +85,7 @@ const cs = ({dirname, platform}) => ({
|
|
|
85
85
|
line: [
|
|
86
86
|
platform === 'win32'
|
|
87
87
|
? ['dotnet', 'run', '--project', `${dirname}/cs/cs.csproj`]
|
|
88
|
-
// .Net on Linux and
|
|
88
|
+
// .Net on Linux and MacOS doesn't properly support COM object marshalling
|
|
89
89
|
: ['dotnet', 'build', `${dirname}/cs/cs.csproj`]
|
|
90
90
|
],
|
|
91
91
|
})
|
package/com/test/cpp/main.cpp
CHANGED
|
@@ -15,11 +15,18 @@ extern "C" int c_get()
|
|
|
15
15
|
|
|
16
16
|
class Impl: public My::IMy
|
|
17
17
|
{
|
|
18
|
+
public:
|
|
18
19
|
My::Slice COM_STDCALL GetSlice() noexcept override
|
|
19
20
|
{
|
|
20
21
|
}
|
|
21
22
|
void COM_STDCALL SetSlice(My::Slice slice) noexcept override
|
|
22
23
|
{
|
|
24
|
+
std::cout
|
|
25
|
+
<< "SetSlice: "
|
|
26
|
+
<< (slice.Start - static_cast<uint8_t*>(nullptr))
|
|
27
|
+
<< ", "
|
|
28
|
+
<< slice.Size
|
|
29
|
+
<< std::endl;
|
|
23
30
|
}
|
|
24
31
|
::com::BOOL *COM_STDCALL GetUnsafe() noexcept override
|
|
25
32
|
{
|
|
@@ -30,16 +37,29 @@ class Impl: public My::IMy
|
|
|
30
37
|
::com::BOOL COM_STDCALL Some(My::IMy &p) noexcept override
|
|
31
38
|
{
|
|
32
39
|
}
|
|
33
|
-
|
|
40
|
+
My::IMy* COM_STDCALL GetIMy() noexcept override
|
|
34
41
|
{
|
|
42
|
+
return ::com::to_ref(*this).unsafe_result();
|
|
35
43
|
}
|
|
36
44
|
void COM_STDCALL SetManagedStruct(My::ManagedStruct a) noexcept override
|
|
37
45
|
{
|
|
38
46
|
}
|
|
47
|
+
~Impl()
|
|
48
|
+
{
|
|
49
|
+
::std::cout << "done" << std::endl;
|
|
50
|
+
}
|
|
39
51
|
};
|
|
40
52
|
|
|
41
53
|
DLL_EXPORT
|
|
42
54
|
extern "C" My::IMy* c_my_create()
|
|
43
55
|
{
|
|
44
|
-
|
|
56
|
+
{
|
|
57
|
+
auto const x = ::com::implementation<Impl>::create().unsafe_result();
|
|
58
|
+
x->Release();
|
|
59
|
+
}
|
|
60
|
+
{
|
|
61
|
+
auto const x = ::com::implementation<Impl>::create().upcast<My::IMy>();
|
|
62
|
+
x->SetSlice(My::Slice());
|
|
63
|
+
}
|
|
64
|
+
return ::com::implementation<Impl>::create().unsafe_result();
|
|
45
65
|
}
|
package/com/test/cs/Program.cs
CHANGED
|
@@ -21,4 +21,11 @@ Console.WriteLine(c_get());
|
|
|
21
21
|
var x = rust_my_create();
|
|
22
22
|
x.SetSlice(new Slice { Start = null, Size = (UIntPtr)44 });
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
{
|
|
25
|
+
var y = c_my_create();
|
|
26
|
+
y.SetSlice(new Slice { Start = null, Size = (UIntPtr)45 });
|
|
27
|
+
var t = y.GetIMy();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
GC.Collect();
|
|
31
|
+
Console.WriteLine("ok");
|
package/fsm/module.f.cjs
CHANGED
|
@@ -1,21 +1,64 @@
|
|
|
1
|
-
const { todo } = require('../dev/module.f.cjs')
|
|
2
1
|
const list = require('../types/list/module.f.cjs')
|
|
2
|
+
const { equal, isEmpty, fold, toArray, scan } = list
|
|
3
3
|
const byteSet = require('../types/byte_set/module.f.cjs')
|
|
4
|
+
const { toRangeMap } = byteSet
|
|
5
|
+
const sortedSet = require('../types/sorted_set/module.f.cjs')
|
|
6
|
+
const { intersect, union } = sortedSet
|
|
7
|
+
const rangeMap = require('../types/range_map/module.f.cjs')
|
|
8
|
+
const { merge } = rangeMap
|
|
9
|
+
const { unsafeCmp } = require('../types/function/compare/module.f.cjs')
|
|
10
|
+
const operator = require("../types/function/operator/module.f.cjs")
|
|
11
|
+
const { strictEqual } = operator
|
|
12
|
+
const { stringify } = require('../json/module.f.cjs')
|
|
13
|
+
const { identity } = require('../types/function/module.f.cjs')
|
|
4
14
|
|
|
5
15
|
/** @typedef {readonly[string, byteSet.ByteSet, string]} Rule */
|
|
6
16
|
|
|
7
17
|
/** @typedef {list.List<Rule>} Grammar */
|
|
8
18
|
|
|
9
|
-
/** @typedef {readonly string[]} ByteMap */
|
|
10
|
-
|
|
11
19
|
/**
|
|
12
20
|
* @typedef {{
|
|
13
|
-
* readonly[state in string]:
|
|
21
|
+
* readonly[state in string]: rangeMap.RangeMapArray<string>
|
|
14
22
|
* }} Dfa
|
|
15
23
|
*/
|
|
16
24
|
|
|
25
|
+
const stringifyIdentity = stringify(identity)
|
|
26
|
+
|
|
27
|
+
/** @type {rangeMap.Operators<sortedSet.SortedSet<string>>} */
|
|
28
|
+
const mergeOp = { union: union(unsafeCmp), equal: equal(strictEqual) }
|
|
29
|
+
|
|
30
|
+
/** @type {(s: string) => (set: sortedSet.SortedSet<string>) => boolean} */
|
|
31
|
+
const hasState = s => set => !isEmpty(intersect(unsafeCmp)([s])(set))
|
|
32
|
+
|
|
33
|
+
/** @type {(set: sortedSet.SortedSet<string>) => operator.Fold<Rule, rangeMap.RangeMap<sortedSet.SortedSet<string>>>} */
|
|
34
|
+
const foldOp = set => ([ruleIn, bs, ruleOut]) => rm => {
|
|
35
|
+
if (hasState(ruleIn)(set)) { return merge(mergeOp)(rm)(toRangeMap(bs)(ruleOut)) }
|
|
36
|
+
return rm
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** @type {operator.Scan<rangeMap.Entry<sortedSet.SortedSet<string>>, rangeMap.Entry<string>>} */
|
|
40
|
+
const stringifyOp = ([sortedSet, max]) => [[stringifyIdentity(sortedSet), max], stringifyOp]
|
|
41
|
+
|
|
42
|
+
const scanStringify = scan(stringifyOp)
|
|
43
|
+
|
|
44
|
+
/** @type {operator.Scan<rangeMap.Entry<sortedSet.SortedSet<string>>, sortedSet.SortedSet<string>>} */
|
|
45
|
+
const fetchOp = ([item, _]) => [item, fetchOp]
|
|
46
|
+
|
|
47
|
+
const scanFetch = scan(fetchOp)
|
|
48
|
+
|
|
49
|
+
/** @type {(grammar: Grammar) => operator.Fold<sortedSet.SortedSet<string>, Dfa>} */
|
|
50
|
+
const addEntry = grammar => set => dfa => {
|
|
51
|
+
const s = stringifyIdentity(set)
|
|
52
|
+
if (s in dfa) { return dfa }
|
|
53
|
+
const setMap = fold(foldOp(set))(undefined)(grammar)
|
|
54
|
+
const stringMap = toArray(scanStringify(setMap))
|
|
55
|
+
const newDfa = { ...dfa, [s]: stringMap }
|
|
56
|
+
const newStates = scanFetch(setMap)
|
|
57
|
+
return fold(addEntry(grammar))(newDfa)(newStates)
|
|
58
|
+
}
|
|
59
|
+
|
|
17
60
|
/** @type {(grammar: Grammar) => Dfa} */
|
|
18
|
-
const dfa = grammar =>
|
|
61
|
+
const dfa = grammar => addEntry(grammar)([''])({})
|
|
19
62
|
|
|
20
63
|
module.exports = {
|
|
21
64
|
/** @readonly */
|
package/fsm/test.f.cjs
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
const _ = require('./module.f.cjs')
|
|
2
|
+
const byteSet = require('../types/byte_set/module.f.cjs')
|
|
3
|
+
const { sort, fromEntries } = require('../types/object/module.f.cjs')
|
|
4
|
+
const json = require('../json/module.f.cjs')
|
|
5
|
+
const { identity } = require('../types/function/module.f.cjs')
|
|
6
|
+
|
|
7
|
+
/** @type {(c: string) => number} */
|
|
8
|
+
const toCharCode = c => c.charCodeAt(0)
|
|
2
9
|
|
|
3
10
|
module.exports = {
|
|
11
|
+
dfa: () => {
|
|
12
|
+
const lowercaseAlpha = byteSet.range([toCharCode('a'), toCharCode('z')])
|
|
13
|
+
const uppercaseAlpha = byteSet.range([toCharCode('A'), toCharCode('Z')])
|
|
14
|
+
const alpha = byteSet.union(lowercaseAlpha)(uppercaseAlpha)
|
|
15
|
+
const idSymbol = byteSet.union(byteSet.one(toCharCode('_')))(byteSet.one(toCharCode('$')))
|
|
16
|
+
const idBegin = byteSet.union(alpha)(idSymbol)
|
|
17
|
+
const digit = byteSet.range([toCharCode('0'), toCharCode('9')])
|
|
18
|
+
const idNext = byteSet.union(idBegin)(digit)
|
|
19
|
+
const dot = byteSet.one(toCharCode('.'))
|
|
20
|
+
|
|
21
|
+
/** @type {_.Grammar} */
|
|
22
|
+
const grammar = [
|
|
23
|
+
['', digit, 'int'],
|
|
24
|
+
['int', digit, 'int'],
|
|
25
|
+
['', digit, 'floatBegin'],
|
|
26
|
+
['floatBegin', digit, 'floatBegin'],
|
|
27
|
+
['floatBegin', dot, 'floatDot'],
|
|
28
|
+
['floatDot', digit, 'float'],
|
|
29
|
+
['float', digit, 'float'],
|
|
30
|
+
['', idBegin, 'id'],
|
|
31
|
+
['id', idNext, 'id']
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
const dfa = _.dfa(grammar)
|
|
35
|
+
const entries = Object.entries(dfa)
|
|
36
|
+
const sortedEntries = sort(entries)
|
|
37
|
+
const obj = fromEntries(sortedEntries)
|
|
38
|
+
const result = json.stringify(identity)(obj)
|
|
39
|
+
|
|
40
|
+
const expectedObj = {
|
|
41
|
+
'[""]': [
|
|
42
|
+
[ '[]', 35 ],
|
|
43
|
+
[ '["id"]', 36 ],
|
|
44
|
+
[ '[]', 47 ],
|
|
45
|
+
[ '["floatBegin","int"]', 57 ],
|
|
46
|
+
[ '[]', 64 ],
|
|
47
|
+
[ '["id"]', 90 ],
|
|
48
|
+
[ '[]', 94 ],
|
|
49
|
+
[ '["id"]', 95 ],
|
|
50
|
+
[ '[]', 96 ],
|
|
51
|
+
[ '["id"]', 122 ]
|
|
52
|
+
],
|
|
53
|
+
'["float"]': [ [ '[]', 47 ], [ '["float"]', 57 ] ],
|
|
54
|
+
'["floatBegin","int"]': [
|
|
55
|
+
[ '[]', 45 ],
|
|
56
|
+
[ '["floatDot"]', 46 ],
|
|
57
|
+
[ '[]', 47 ],
|
|
58
|
+
[ '["floatBegin","int"]', 57 ]
|
|
59
|
+
],
|
|
60
|
+
'["floatDot"]': [ [ '[]', 47 ], [ '["float"]', 57 ] ],
|
|
61
|
+
'["id"]': [
|
|
62
|
+
[ '[]', 35 ],
|
|
63
|
+
[ '["id"]', 36 ],
|
|
64
|
+
[ '[]', 47 ],
|
|
65
|
+
[ '["id"]', 57 ],
|
|
66
|
+
[ '[]', 64 ],
|
|
67
|
+
[ '["id"]', 90 ],
|
|
68
|
+
[ '[]', 94 ],
|
|
69
|
+
[ '["id"]', 95 ],
|
|
70
|
+
[ '[]', 96 ],
|
|
71
|
+
[ '["id"]', 122 ]
|
|
72
|
+
],
|
|
73
|
+
'[]': []
|
|
74
|
+
};
|
|
75
|
+
const expectedResult = json.stringify(identity)(expectedObj)
|
|
4
76
|
|
|
77
|
+
if (result !== expectedResult) {throw result }
|
|
78
|
+
}
|
|
5
79
|
}
|
package/package.json
CHANGED
package/sha2/module.f.cjs
CHANGED
|
@@ -22,15 +22,15 @@ const padding = input => bitsCount => {
|
|
|
22
22
|
const appendBlockIndex = (bitsCount / 32) | 0
|
|
23
23
|
const length = (bitsCount + mod(447 - bitsCount)(512) + 65) / 32
|
|
24
24
|
/** @type {(i: number) => number} */
|
|
25
|
-
const f = i =>
|
|
26
|
-
i < appendBlockIndex
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
i === length - 2
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
const f = i => {
|
|
26
|
+
if (i < appendBlockIndex) { return input[i] }
|
|
27
|
+
if (i === appendBlockIndex) {
|
|
28
|
+
return appendBlockIndex >= input.length ? 0x8000_0000 : appendOneWithZeros(input[appendBlockIndex])(31 - bitsCount % 32)
|
|
29
|
+
}
|
|
30
|
+
if (i === length - 2) { return (bitsCount / 0x1_0000_0000) | 0 }
|
|
31
|
+
if (i === length - 1) { return bitsCount % 0x1_0000_0000 }
|
|
32
|
+
return 0
|
|
33
|
+
}
|
|
34
34
|
return ({ f, length })
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -97,6 +97,25 @@ const nextW = ([w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, wA, wB, wC, wD, wE, wF])
|
|
|
97
97
|
return [w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, wA, wB, wC, wD, wE, wF]
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
const k = [
|
|
101
|
+
[
|
|
102
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
103
|
+
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
107
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
111
|
+
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
115
|
+
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
|
116
|
+
],
|
|
117
|
+
];
|
|
118
|
+
|
|
100
119
|
/** @type {(init: Hash8) => (data: Array16) => Hash8} */
|
|
101
120
|
const compress = ([a0, b0, c0, d0, e0, f0, g0, h0]) => data => {
|
|
102
121
|
let w = data
|
|
@@ -165,21 +184,6 @@ const computeSha256 = compute(init256)
|
|
|
165
184
|
/** @type {Hash8} */
|
|
166
185
|
const init224 = [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]
|
|
167
186
|
|
|
168
|
-
const k = [
|
|
169
|
-
[
|
|
170
|
-
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
171
|
-
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174],
|
|
172
|
-
[
|
|
173
|
-
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
174
|
-
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967],
|
|
175
|
-
[
|
|
176
|
-
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
177
|
-
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070],
|
|
178
|
-
[
|
|
179
|
-
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
180
|
-
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2],
|
|
181
|
-
];
|
|
182
|
-
|
|
183
187
|
/** @type {(input: readonly number[]) => (bitsCount: number) => Hash8} */
|
|
184
188
|
const computeSha224 = compute(init224)
|
|
185
189
|
|