add option to pass key pwd from arg
This commit is contained in:
parent
c0152e7608
commit
acd5c8445e
2 changed files with 14 additions and 7 deletions
|
|
@ -143,7 +143,7 @@ impl StringDataItem {
|
|||
let two = self.data[i] as u32;
|
||||
i += 1;
|
||||
if one & 0x20 == 0 {
|
||||
utf16_string.push((one & 0x1f) << 6 | (two & 0x3f));
|
||||
utf16_string.push(((one & 0x1f) << 6) | (two & 0x3f));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ impl StringDataItem {
|
|||
let three = self.data[i] as u32;
|
||||
i += 1;
|
||||
if one & 0x10 == 0 {
|
||||
utf16_string.push((one & 0x0f) << 12 | (two & 0x3f) << 6 | (three & 0x3f));
|
||||
utf16_string.push(((one & 0x0f) << 12) | ((two & 0x3f) << 6) | (three & 0x3f));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ impl StringDataItem {
|
|||
let four = self.data[i] as u32;
|
||||
i += 1;
|
||||
let code_point =
|
||||
(one & 0x0f) << 18 | (two & 0x3f) << 12 | (three & 0x3f) << 6 | (four & 0x3f);
|
||||
((one & 0x0f) << 18) | ((two & 0x3f) << 12) | ((three & 0x3f) << 6) | (four & 0x3f);
|
||||
let mut pair = ((code_point >> 10) + 0xd7c0) & 0xffff;
|
||||
pair |= ((code_point & 0x03ff) + 0xdc00) << 16;
|
||||
utf16_string.push(pair);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue