skip to main content
paste
bin
.ca
type · paste · share
⌘
K
Sign in
?
Account
More
▾
Docs
Family
The bin family
pastebin.ca
hub
Share text and code with expiry and privacy controls.
imagebin.ca
Upload and share images with direct links.
filebin.ca
Drop a file and get a shareable link.
notebin.ca
Write Markdown notes with durable links.
turl.ca
Short, reputation-checked links.
attn.ca
Notifications and alerts for your services.
voicebin.ca
Record and share short voice clips.
dnsbin.ca
Inspect DNS and debug records.
← back to paste
›
Edit / fork
Untitled paste
#2vFJvYEQrB
public / public
new version
anonymous
created 2 days ago
Expires in 5 days
1.7 KB
syntax:
text
Your changes create a new paste linked to this one — the original is untouched.
new version
Your changes create a new paste linked to this one — the original is untouched.
Title (optional)
Filename
Syntax
text
text
bash
c
cpp
css
diff
dockerfile
go
html
ini
java
javascript
json
kotlin
lua
makefile
markdown
nginx
php
python
ruby
rust
shellscript
sql
swift
toml
typescript
xml
yaml
Visibility
Public feed
Access
public
Expires
7 days
10 min
1 hour
1 day
7 days
30 days
90 days
custom…
Custom expiry
Change note
(optional)
Anyone can find this paste in the public feed. Choose Unlisted to share it only by link.
Create new version
Cancel
Paste or type…
# estimate.py —— 数制转换与存储容量估算验证脚本 # 单位约定:1 MB = 10^6 B,1 MiB = 2^20 B,1 GB = 10^9 B,1 GiB = 2^30 B def show_num_systems(): print("=== 一、数制转换验证 ===") b = '10110101' print(f"int('{b}', 2) = {int(b, 2)}") # 期望 181 print(f"hex(255) = {hex(255)}") # 期望 0xff print(f"bin(0x1A) = {bin(0x1A)}") # 期望 0b11010 print(f"int('1A', 16) = {int('1A', 16)}") # 期望 26 def photo_size(w=1920, h=1080, depth=24): bits = w * h * depth bytes_ = bits / 8 return bits, bytes_, bytes_ / 1e6, bytes_ / 2**20 def audio_size(minutes=4, sr=44100, bits=16, ch=2): seconds = minutes * 60 bits_total = sr * bits * ch * seconds bytes_ = bits_total / 8 return bits_total, bytes_, bytes_ / 1e6, bytes_ / 2**20 def video_size(hours=2, mbps=8): seconds = hours * 3600 bits_total = mbps * 1e6 * seconds bytes_ = bits_total / 8 return bits_total, bytes_, bytes_ / 1e9, bytes_ / 2**30 def iphone_shot_size(w=2868, h=1320, depth=24): bits = w * h * depth bytes_ = bits / 8 return bits, bytes_, bytes_ / 1e6, bytes_ / 2**20 def report(name, bits, bytes_, dec, bin_): print(f"\n{name}: {bits:,} bit = {bytes_:,.0f} B " f"≈ {dec:.2f} MB/GB ≈ {bin_:.2f} MiB/GiB") if __name__ == '__main__': show_num_systems() print("\n=== 二、存储容量估算 ===") report("1920×1080×24bit 未压缩照片", *photo_size()) report("4分钟 44.1kHz/16bit 双声道音频", *audio_size()) report("2小时 8Mbps 视频", *video_size()) report("iPhone 16 Pro Max 截图 2868×1320×24bit 未压缩", *iphone_shot_size())