MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

hashes/sha256.py:34–118  ·  view source on GitHub ↗
(self, data: bytes)

Source from the content-addressed store, hash-verified

32 """
33
34 def __init__(self, data: bytes) -> None:
35 self.data = data
36
37 # Initialize hash values
38 self.hashes = [
39 0x6A09E667,
40 0xBB67AE85,
41 0x3C6EF372,
42 0xA54FF53A,
43 0x510E527F,
44 0x9B05688C,
45 0x1F83D9AB,
46 0x5BE0CD19,
47 ]
48
49 # Initialize round constants
50 self.round_constants = [
51 0x428A2F98,
52 0x71374491,
53 0xB5C0FBCF,
54 0xE9B5DBA5,
55 0x3956C25B,
56 0x59F111F1,
57 0x923F82A4,
58 0xAB1C5ED5,
59 0xD807AA98,
60 0x12835B01,
61 0x243185BE,
62 0x550C7DC3,
63 0x72BE5D74,
64 0x80DEB1FE,
65 0x9BDC06A7,
66 0xC19BF174,
67 0xE49B69C1,
68 0xEFBE4786,
69 0x0FC19DC6,
70 0x240CA1CC,
71 0x2DE92C6F,
72 0x4A7484AA,
73 0x5CB0A9DC,
74 0x76F988DA,
75 0x983E5152,
76 0xA831C66D,
77 0xB00327C8,
78 0xBF597FC7,
79 0xC6E00BF3,
80 0xD5A79147,
81 0x06CA6351,
82 0x14292967,
83 0x27B70A85,
84 0x2E1B2138,
85 0x4D2C6DFC,
86 0x53380D13,
87 0x650A7354,
88 0x766A0ABB,
89 0x81C2C92E,
90 0x92722C85,
91 0xA2BFE8A1,

Callers

nothing calls this directly

Calls 2

preprocessingMethod · 0.95
final_hashMethod · 0.95

Tested by

no test coverage detected