3 ms·
You might also consider removing UTF8Encoding from SHA1 implementation, I might be wrong, but I think contest states no encoding should be used - i.e. ASCII onl
by rarestblog 17y ago
You might also consider removing UTF8Encoding from SHA1 implementation, I might be wrong, but I think contest states no encoding should be used - i.e. ASCII only. If that's a care, that's a useless O(N) operation.
- sp332 17y agoUTF8(ASCII) == ASCII Unless you're using characters > 255, UTF-8 is identical to ASCII.
- m_eiman 17y agoActually it's UTF8(ASCII) == ASCII iff ASCII < 128, since the MSB signifies a multi-byte character. http://en.wikipedia.org/wiki/UTF-8 http://en.wikipedia.org/wiki/UTF-8 Hm, on second thought UTF8(ASCII) is -always- == ASCII, since ASCII is only defined for 0-127, unless you count the extended variants :P http://en.wikipedia.org/wiki/ASCII http://en.wikipedia.org/wiki/ASCII