I moved from MA to CA in March 2018, so I spent 25% of the year as a MA resident and 75% as a CA resident. I contributed to the max $3450 for 2018. I was lucky that my MA employer contributed $1600 upfront into my HSA account in Jan 2018 while I was a resident of MA
The IRS will not use a method to auto verify your amounts to each state, because for the IRS, HSA contributions are treated the same way for every state.
It is California that will care. I have not seen a formula that California would use to figure the allocation (they may not even have one). Pick a formula that you are comfortable with and document it and leave it in your tax files in case anyone in California ever writes you a letter asking how you came to that number.