Title: Interface Crypto does not implement RandomSource, so Crypto.getRandomValues is not generic · Issue #23646 · microsoft/TypeScript · GitHub
Open Graph Title: Interface Crypto does not implement RandomSource, so Crypto.getRandomValues is not generic · Issue #23646 · microsoft/TypeScript
X Title: Interface Crypto does not implement RandomSource, so Crypto.getRandomValues is not generic · Issue #23646 · microsoft/TypeScript
Description: TypeScript Version: 2.8.3 Search Terms: getRandomValues Code crypto.getRandomValues(new Uint32Array(2)).join('') Expected behavior: Get a concated string of 2 random uint32. Actual behavior: Compiler error: Property 'join' does not exist...
Open Graph Description: TypeScript Version: 2.8.3 Search Terms: getRandomValues Code crypto.getRandomValues(new Uint32Array(2)).join('') Expected behavior: Get a concated string of 2 random uint32. Actual behavior: Compil...
X Description: TypeScript Version: 2.8.3 Search Terms: getRandomValues Code crypto.getRandomValues(new Uint32Array(2)).join('') Expected behavior: Get a concated string of 2 random uint32. Actual behavior...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/23646
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Interface Crypto does not implement RandomSource, so Crypto.getRandomValues is not generic","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨 -->\r\n\u003c!--\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the CONTRIBUTING guidelines: https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n-->\r\n\r\n\u003c!-- If you have a QUESTION:\r\n THIS IS NOT A FORUM FOR QUESTIONS.\r\n Ask questions at http://stackoverflow.com/questions/tagged/typescript\r\n or https://gitter.im/Microsoft/TypeScript\r\n-->\r\n\r\n\u003c!-- If you have a SUGGESTION:\r\n Most suggestion reports are duplicates, please search extra hard before logging a new suggestion.\r\n See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md\r\n-->\r\n\r\n\u003c!-- If you have a BUG:\r\n Please fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 2.8.3\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\n\r\n* getRandomValues\r\n\r\n**Code**\r\n\r\n```ts\r\ncrypto.getRandomValues(new Uint32Array(2)).join('')\r\n```\r\n\r\n**Expected behavior:**\r\nGet a concated string of 2 random uint32.\r\n\r\n**Actual behavior:**\r\nCompiler error:\r\n`Property 'join' does not exist on type 'Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray ...'.\r\n Property 'join' does not exist on type 'DataView'.`\r\n\r\nLooks like Microsoft/TSJS-lib-generator#278 is not included or overwritten by someone.\r\nI suggest to simply extend the `Crypto` interface from the `RandomSource` interface.\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior --> \r\n\r\nhttps://www.typescriptlang.org/play/#src=crypto.getRandomValues(new%20Uint32Array(2)).join('')\r\n\r\n**Related Issues:**\r\n#17610","author":{"url":"https://github.com/viceice","@type":"Person","name":"viceice"},"datePublished":"2018-04-24T05:42:41Z","url":"https://github.com/microsoft/TypeScript/issues/23646"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:24e711a7-10d0-3433-98b6-6e309f4e6d4f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E184:19E4BB:CC46E2:105DAB8:6B0101D4 |
| html-safe-nonce | cf19e61f8115f74b8b6ff4a884ba527d20c03fb0d02c5da0e23cccaa82987d80 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTg0OjE5RTRCQjpDQzQ2RTI6MTA1REFCODo2QjAxMDFENCIsInZpc2l0b3JfaWQiOiI3ODA0NzU5MjY1NzkyNTU3NTI0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3284fb753f11e5e3b188c8b5096ae4e81181be9f68017ca08a082efdb85c30d1 |
| hovercard-subject-tag | issue:317077452 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/23646/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bf3cd11142e150fa87d0e1377923f7bbbb1a60466c520ee6d3ff19144aad1ac9/microsoft/TypeScript/issues/23646 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bf3cd11142e150fa87d0e1377923f7bbbb1a60466c520ee6d3ff19144aad1ac9/microsoft/TypeScript/issues/23646 |
| og:image:alt | TypeScript Version: 2.8.3 Search Terms: getRandomValues Code crypto.getRandomValues(new Uint32Array(2)).join('') Expected behavior: Get a concated string of 2 random uint32. Actual behavior: Compil... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | viceice |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width