<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>absg</author_name>
  <author_url>https://blog.hatena.ne.jp/absg/</author_url>
  <blog_title>やったこと</blog_title>
  <blog_url>https://absg.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>PHPで2chの書き込みID風のユニークな文字列を生成するアルゴリズムです。以下のような感じのやつを出力します。 ↓ 「id:kh9D1A2c」 コメント投稿者の「IPアドレス」と「書き込み時刻」を連結した文字列をsha1-hmacでハッシュ化します。 同じ日付で同じIPアドレスから書き込みをすると、同じIDが生成されるという訳です。コードは以下の通り。 //初期パラメータ $ip = &quot;192.168.1.1&quot;; $timestamp = &quot;2017-10-06&quot;; $secret = &quot;hogegefugagapiyoyo&quot;; //sha1を使ってハッシュ化 $id_hash = hash…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fabsg.hatenablog.com%2Fentry%2F2017%2F10%2F06%2F201424&quot; title=&quot;PHPで2chの書き込みIDのような文字列を生成するアルゴリズム！ - やったこと&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-10-06 20:14:24</published>
  <title>PHPで2chの書き込みIDのような文字列を生成するアルゴリズム！</title>
  <type>rich</type>
  <url>https://absg.hatenablog.com/entry/2017/10/06/201424</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
