MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / sha1_buffer

Method sha1_buffer

core/string/ustring.cpp:2854–2867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2852}
2853
2854Vector<uint8_t> String::sha1_buffer() const {
2855 CharString cs = utf8();
2856 unsigned char hash[20];
2857 CryptoCore::sha1((unsigned char *)cs.ptr(), cs.length(), hash);
2858
2859 Vector<uint8_t> ret;
2860 ret.resize_uninitialized(20);
2861 uint8_t *ret_ptrw = ret.ptrw();
2862 for (int i = 0; i < 20; i++) {
2863 ret_ptrw[i] = hash[i];
2864 }
2865
2866 return ret;
2867}
2868
2869Vector<uint8_t> String::sha256_buffer() const {
2870 CharString cs = utf8();

Callers 2

_compute_key_responseMethod · 0.80
test_string.hFile · 0.80

Calls 4

ptrMethod · 0.45
lengthMethod · 0.45
resize_uninitializedMethod · 0.45
ptrwMethod · 0.45

Tested by

no test coverage detected