diff options
| author | Juan Linietsky | 2014-08-01 22:10:38 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-08-01 22:10:38 -0300 |
| commit | 678948068bbde7f12a9c5f28a467b6cf4d127851 (patch) | |
| tree | 75572f3a5cc6089a6ca3046e9307d0a7c0b72c51 /core/ustring.cpp | |
| parent | 9ff6d55822647c87eef392147ea15641d0922d47 (diff) | |
| download | godot-678948068bbde7f12a9c5f28a467b6cf4d127851.tar.gz godot-678948068bbde7f12a9c5f28a467b6cf4d127851.tar.zst godot-678948068bbde7f12a9c5f28a467b6cf4d127851.zip | |
Diffstat (limited to 'core/ustring.cpp')
| -rw-r--r-- | core/ustring.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index 00477e757..cb0540dbb 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -2276,6 +2276,24 @@ String String::md5_text() const { return String::md5(ctx.digest); } +Vector<uint8_t> String::md5_buffer() const { + + CharString cs=utf8(); + MD5_CTX ctx; + MD5Init(&ctx); + MD5Update(&ctx,(unsigned char*)cs.ptr(),cs.length()); + MD5Final(&ctx); + + Vector<uint8_t> ret; + ret.resize(16); + for (int i=0; i<16; i++) { + ret[i] = ctx.digest[i]; + }; + + return ret; +}; + + String String::insert(int p_at_pos,String p_string) const { if (p_at_pos<0) |
