Skip to content

TurboBytes Extension#2415

Open
OrangeHub10 wants to merge 2 commits intoTurboWarp:masterfrom
OrangeHub10:master
Open

TurboBytes Extension#2415
OrangeHub10 wants to merge 2 commits intoTurboWarp:masterfrom
OrangeHub10:master

Conversation

@OrangeHub10
Copy link

Hi!, Today Thanks To Google Ai And Me, I Made This Extension Called, TurboBytes, I Hope It Can Be In The File Revision!

Backup: If The File Has Been Corrupted Or Useless, Here Is A Backup Code!

(function(Scratch) { 'use strict'; class DataConverter { getInfo() { return { id: 'dataconverter', name: 'TurboBytes', color1: '#ff4c4c', blocks: [ { opcode: 'getConvertedSize', blockType: Scratch.BlockType.REPORTER, text: 'Bytes of [TEXTO] in [UNIT]', arguments: { TEXTO: { type: Scratch.ArgumentType.STRING, defaultValue: 'Bytes' }, UNIT: { type: Scratch.ArgumentType.STRING, menu: 'unitsMenu', defaultValue: 'Bytes' } } } ], menus: { unitsMenu: { acceptReporters: true, items: ['Bytes', 'Kilobytes', 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Exabytes', 'Zettabytes', 'Yottabytes', 'Bits', 'Nibbles', 'Kibibytes'] } } }; } getConvertedSize(args) { const bytes = new Blob([args.TEXTO]).size; const unit = args.UNIT; switch (unit) { case 'Kilobytes': return bytes / 1000; case 'Megabytes': return bytes / Math.pow(1024, 2); case 'Gigabytes': return bytes / Math.pow(1024, 3); case 'Terabytes': return bytes / Math.pow(1024, 4); case 'Petabytes': return bytes / Math.pow(1024, 5); case 'Exabytes': return bytes / Math.pow(1024, 6); case 'Zettabytes': return bytes / Math.pow(1024, 7); case 'Yottabytes': return bytes / Math.pow(1024, 8); case 'Bytes': return bytes; case 'Bits' : return bytes * 8; case 'Nibbles' : return bytes * 2; case 'Kibibytes' : return bytes / 1024; default: return 0; } } } Scratch.extensions.register(new DataConverter()); })(Scratch);

@github-actions github-actions bot added the pr: new extension Pull requests that add a new extension label Feb 18, 2026
@Brackets-Coder
Copy link
Contributor

!format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new extension Pull requests that add a new extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments