Merge pull request #5380 from vnen/string-canvasitem-docs
Documentation for String and CanvasItem
This commit is contained in:
commit
d52fa2e0eb
5 changed files with 79 additions and 21 deletions
|
|
@ -2416,6 +2416,23 @@ Vector<uint8_t> String::md5_buffer() const {
|
|||
return ret;
|
||||
};
|
||||
|
||||
Vector<uint8_t> String::sha256_buffer() const {
|
||||
CharString cs = utf8();
|
||||
unsigned char hash[32];
|
||||
sha256_context ctx;
|
||||
sha256_init(&ctx);
|
||||
sha256_hash(&ctx, (unsigned char*)cs.ptr(), cs.length());
|
||||
sha256_done(&ctx, hash);
|
||||
|
||||
Vector<uint8_t> ret;
|
||||
ret.resize(32);
|
||||
for (int i = 0; i < 32; i++) {
|
||||
ret[i] = hash[i];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
String String::insert(int p_at_pos,String p_string) const {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue