Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » Project ID question
- ten_6044
-
100+ posts
Project ID question
What is the number format used for storing project IDs?
I'm worried because I thought they were stored as 32-bit signed integers, which allow numbers up to 2,147,483,647.
I'm worried because I thought they were stored as 32-bit signed integers, which allow numbers up to 2,147,483,647.
- AmpElectrecuted
-
1000+ posts
Project ID question
I remember you from snap!
I'm not exactly sure how they're stored, but I believe the scratch team can convert them to 64-bit integers, which can hold over 18 quintillion projects, wayy more than there are people in the world
We won't be in danger for a few years though
I'm not exactly sure how they're stored, but I believe the scratch team can convert them to 64-bit integers, which can hold over 18 quintillion projects, wayy more than there are people in the world
We won't be in danger for a few years though
Last edited by AmpElectrecuted (Feb. 1, 2025 08:17:16)
- eisjo
-
100+ posts
Project ID question
The integer limit is only for 32 bits: 2147483647.
For 64 bits it is: 18446744073709551615.
Don't are worried.
For 64 bits it is: 18446744073709551615.
Don't are worried.

- mybearworld
-
1000+ posts
Project ID question
Scratch uses Node.js for its backend, so the limit might be highest number that a `Number` can represent, which is 9007199254740991.
it's much more likely that jeffalo is right, ↓
it's much more likely that jeffalo is right, ↓
Last edited by mybearworld (Feb. 2, 2025 13:42:11)
- Jeffalo
-
1000+ posts
Project ID question
i think scratch uses a mysql “INT” to store project ids. according my good friend chatgpt, mysql INTs can store up to values up to 2,147,483,647. so unless anyones planning on making a couple billion projects, we're probably fine.
- CST1229
-
1000+ posts
Project ID question
(#5)however, this *does* mean we are halfway to an integer overflow… (though the st will probably figure something out before then, and there's also the gap of project ids between 1.x and 2.0 alpha that might mean the number of projects actually increment slower than the ids might suggest?)
i think scratch uses a mysql “INT” to store project ids. according my good friend chatgpt, mysql INTs can store up to values up to 2,147,483,647. so unless anyones planning on making a couple billion projects, we're probably fine.
Last edited by CST1229 (Feb. 2, 2025 13:31:57)
- CoderMCProX
-
1000+ posts
Project ID question
The oldest has an ID of 103 or 104, and it is by when they are posted… or at least that is what I heard? What is the number format used for storing project IDs?
I'm worried because I thought they were stored as 32-bit signed integers, which allow numbers up to 2,147,483,647.
Last edited by CoderMCProX (Feb. 3, 2025 13:44:38)
- BigNate469
-
1000+ posts
Project ID question
The oldest project on the website has an ID of 1.The oldest has an ID of 103 or 104, and it is by when they are posted… or at least that is what I heard? What is the number format used for storing project IDs?
I'm worried because I thought they were stored as 32-bit signed integers, which allow numbers up to 2,147,483,647.
The oldest project that is still shared is #104.
This isn't really related to the question though.
I imagine that the Scratch Team is prepared to deal with an overflow, and keep in mind that it doesn't need to be a signed 32-bit integer, since negative project IDs don't exist, so they could just use an unsigned integer and double the amount of possible projects. Alternatively, they could just start using a MySql BIGINT, which uses a 64-bit integer.
Last edited by BigNate469 (Feb. 3, 2025 15:32:10)
- Discussion Forums
- » Questions about Scratch
-
» Project ID question