(str)
| 183 | } |
| 184 | |
| 185 | function stringToId(str) { |
| 186 | let hash = 0, |
| 187 | i, |
| 188 | chr; |
| 189 | if (str.length === 0) return hash.toString(); |
| 190 | for (i = 0; i < str.length; i++) { |
| 191 | chr = str.charCodeAt(i); |
| 192 | hash = (hash << 5) - hash + chr; |
| 193 | hash |= 0; // Convert to 32bit integer |
| 194 | } |
| 195 | return "id_" + Math.abs(hash); |
| 196 | } |
| 197 | |
| 198 | const _queueUpload = []; |
| 199 | let _runningUpload = false; |
no outgoing calls
no test coverage detected