This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Simulate implementation of `encodeURIComponent()` in Cocoa Objective-C that provides similar | |
/// percent-encoding behaviour. | |
/// | |
/// Escapes all characters except: `A–Z a–z 0–9 - _ . ! ~ * ' ( )` | |
+ (NSString *)encodeURIComponent:(NSString *)string { | |
NSMutableCharacterSet *uriComponentAllowedCharacterSet; | |
// Based on `URLQueryAllowedCharacterSet`, while it contains extra characters that need to be | |
// escaped as for `encodeURIComponent()`. | |
uriComponentAllowedCharacterSet = [NSCharacterSet.URLQueryAllowedCharacterSet mutableCopy]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
function CSRFToken(str) { | |
var hash = 5381; | |
for (var i = 0, len = str.length; i < len; ++i) | |
hash += (hash << 5) + str.charAt(i).charCodeAt(); | |
return hash & 2147483647 | |
} | |
function getCookie(c, name) { |