<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-predict-random-numbers-generated-by-computers-tsitkbhlt" -->

---
title: How To Predict Random Numbers Generated By Computers
description: Demonstrates how JavaScript's Math.random() function can be predicted by reverse-engineering the V8 engine's XORShift128 algorithm. The tutorial shows how to...
canonical: https://daily.dev/posts/how-to-predict-random-numbers-generated-by-computers-tsitkbhlt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How To Predict Random Numbers Generated By Computers | daily.dev
og:description: Demonstrates how JavaScript's Math.random() function can be predicted by reverse-engineering the V8 engine's XORShift128 algorithm. The tutorial shows how to...
og:url: https://daily.dev/posts/how-to-predict-random-numbers-generated-by-computers-tsitkbhlt
og:image: https://api.daily.dev/og/posts/tSITkbHLT.png
og:image:alt: How To Predict Random Numbers Generated By Computers
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How To Predict Random Numbers Generated By Computers

**[Community Picks](https://daily.dev/sources/community)** · 13 min read · 2 upvotes · 1 comments

## Summary

Demonstrates how JavaScript's Math.random() function can be predicted by reverse-engineering the V8 engine's XORShift128 algorithm. The tutorial shows how to use Z3 SMT solver to find the internal state values and predict future random numbers, highlighting security vulnerabilities in applications that rely on Math.random() for cryptographic purposes. Emphasizes the importance of using cryptographically secure random number generators instead of pseudo-random generators for security-critical applications.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://youtu.be/-h_rj2-HP2E>

---

Tags: [#security](https://daily.dev/tags/security), [#javascript](https://daily.dev/tags/javascript), [#python](https://daily.dev/tags/python), [#cryptography](https://daily.dev/tags/cryptography), [#v8](https://daily.dev/tags/v8)

[View this post on daily.dev](https://daily.dev/posts/how-to-predict-random-numbers-generated-by-computers-tsitkbhlt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How To Predict Random Numbers Generated By Computers","url":"https://daily.dev/posts/how-to-predict-random-numbers-generated-by-computers-tsitkbhlt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-predict-random-numbers-generated-by-computers-tsitkbhlt"},"datePublished":"2025-06-03T18:45:22.668Z","dateModified":"2025-06-03T18:45:59.408Z","description":"Demonstrates how JavaScript's Math.random() function can be predicted by reverse-engineering the V8 engine's XORShift128 algorithm. The tutorial shows how to...","image":"https://i.ytimg.com/vi/-h_rj2-HP2E/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/-h_rj2-HP2E/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Community Picks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1655817725/logos/community","url":"https://daily.dev/sources/community"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/how-to-predict-random-numbers-generated-by-computers-tsitkbhlt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"security,javascript,python,cryptography,v8","timeRequired":"PT13M","video":{"@type":"VideoObject","name":"How To Predict Random Numbers Generated By Computers","description":"Demonstrates how JavaScript's Math.random() function can be predicted by reverse-engineering the V8 engine's XORShift128 algorithm. The tutorial shows how to...","thumbnailUrl":"https://i.ytimg.com/vi/-h_rj2-HP2E/sddefault.jpg","uploadDate":"2025-06-03T18:45:22.668Z","duration":"PT13M","url":"https://api.daily.dev/r/tSITkbHLT","embedUrl":"https://www.youtube.com/embed/-h_rj2-HP2E"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"How To Predict Random Numbers Generated By Computers"}]}
```

