LoginSignup
0
0

bitとかbyteとかメモる

Last updated at Posted at 2020-07-01

65535なんかの数字にピンとこないと、プログラマとして「あっ...察し」って思われそうなのでまとめる。

bit, Byte

  • 1Byte = 8bit = 0~255
  • 2Byte = 16bit = 0~65535
  • 3Byte = 16bit = 0~16777215

KB, MBとの換算はこれを参考に

1文字は何バイトか?

参考によると

  • 半角文字:1バイト
  • 全角文字:2バイトとか3バイトとか4バイトとか

MySQLとbyte

varchar型

  • 65535 byte が上限 ※
  • すなわち半角文字で65535byte=65535文字まで収納可能

※ つまり、1つの値あたり、64KBの容量を占有する。

text型

無字数無制限

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0